package com.tengju.bff.interfaces.covercharge.constant;
/**
 * 代发服务内部状态枚举
 *
 * @author cj
 */
public enum FundOutFeignClientCodeEnum {
    THREE_FAILED(202931012,"三方接收失败"),
    SUCCESS(0,"成功"),
    REPEAT_TRADE(202931013,"重复交易"),
    QUERY_ERROR(202931015,"查询出错"),
    THREE_ERROR(202931014,"无法解析三方错误码"),
    UN_KNOW(202931016,"其他错误"),
    CONFIG_ERROR(202931017,"渠道实现未配置"),
    KEY_ERROR(202931009,"创建银联代付key失败"),
    SIGN_ERROR(202931010,"验签失败"),
    ORDER_ERROR(203291009,"订单不存在"),
    FAILURE(202931020,"打款失败");

    private Integer code;
    private String desc;

    FundOutFeignClientCodeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode(){
        return this.code;
    }
    public String getDesc(){
        return this.desc;
    }

    public static FundOutFeignClientCodeEnum getClientCodeDesc (Integer code){
        for(FundOutFeignClientCodeEnum codeEnum : (FundOutFeignClientCodeEnum.values())){
            if(codeEnum.getCode().equals(code)){//如果传入的code与此枚举code相同，则返回此枚举
                return codeEnum;
            }
        }
        return null;
    }
}
